(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";

(function e(t, n, r) {
	function s(o, u) {
		if (!n[o]) {
			if (!t[o]) {
				var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
			}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
				var n = t[o][1][e];return s(n ? n : e);
			}, l, l.exports, e, t, n, r);
		}return n[o].exports;
	}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
		s(r[o]);
	}return s;
})({ 1: [function (require, module, exports) {
		"use strict";

		(function e(t, n, r) {
			function s(o, u) {
				if (!n[o]) {
					if (!t[o]) {
						var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
					}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
						var n = t[o][1][e];return s(n ? n : e);
					}, l, l.exports, e, t, n, r);
				}return n[o].exports;
			}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
				s(r[o]);
			}return s;
		})({ 1: [function (require, module, exports) {
				"use strict";

				(function e(t, n, r) {
					function s(o, u) {
						if (!n[o]) {
							if (!t[o]) {
								var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
							}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
								var n = t[o][1][e];return s(n ? n : e);
							}, l, l.exports, e, t, n, r);
						}return n[o].exports;
					}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
						s(r[o]);
					}return s;
				})({ 1: [function (require, module, exports) {
						"use strict";

						(function e(t, n, r) {
							function s(o, u) {
								if (!n[o]) {
									if (!t[o]) {
										var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
									}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
										var n = t[o][1][e];return s(n ? n : e);
									}, l, l.exports, e, t, n, r);
								}return n[o].exports;
							}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
								s(r[o]);
							}return s;
						})({ 1: [function (require, module, exports) {
								"use strict";

								(function e(t, n, r) {
									function s(o, u) {
										if (!n[o]) {
											if (!t[o]) {
												var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
											}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
												var n = t[o][1][e];return s(n ? n : e);
											}, l, l.exports, e, t, n, r);
										}return n[o].exports;
									}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
										s(r[o]);
									}return s;
								})({ 1: [function (require, module, exports) {
										"use strict";

										(function e(t, n, r) {
											function s(o, u) {
												if (!n[o]) {
													if (!t[o]) {
														var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
													}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
														var n = t[o][1][e];return s(n ? n : e);
													}, l, l.exports, e, t, n, r);
												}return n[o].exports;
											}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
												s(r[o]);
											}return s;
										})({ 1: [function (require, module, exports) {
												"use strict";

												(function e(t, n, r) {
													function s(o, u) {
														if (!n[o]) {
															if (!t[o]) {
																var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
															}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
																var n = t[o][1][e];return s(n ? n : e);
															}, l, l.exports, e, t, n, r);
														}return n[o].exports;
													}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
														s(r[o]);
													}return s;
												})({ 1: [function (require, module, exports) {
														"use strict";

														(function e(t, n, r) {
															function s(o, u) {
																if (!n[o]) {
																	if (!t[o]) {
																		var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
																	}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
																		var n = t[o][1][e];return s(n ? n : e);
																	}, l, l.exports, e, t, n, r);
																}return n[o].exports;
															}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
																s(r[o]);
															}return s;
														})({ 1: [function (require, module, exports) {
																"use strict";

																(function e(t, n, r) {
																	function s(o, u) {
																		if (!n[o]) {
																			if (!t[o]) {
																				var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
																			}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
																				var n = t[o][1][e];return s(n ? n : e);
																			}, l, l.exports, e, t, n, r);
																		}return n[o].exports;
																	}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
																		s(r[o]);
																	}return s;
																})({ 1: [function (require, module, exports) {
																		"use strict";

																		(function e(t, n, r) {
																			function s(o, u) {
																				if (!n[o]) {
																					if (!t[o]) {
																						var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
																					}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
																						var n = t[o][1][e];return s(n ? n : e);
																					}, l, l.exports, e, t, n, r);
																				}return n[o].exports;
																			}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
																				s(r[o]);
																			}return s;
																		})({ 1: [function (require, module, exports) {
																				"use strict";

																				(function e(t, n, r) {
																					function s(o, u) {
																						if (!n[o]) {
																							if (!t[o]) {
																								var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
																							}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
																								var n = t[o][1][e];return s(n ? n : e);
																							}, l, l.exports, e, t, n, r);
																						}return n[o].exports;
																					}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
																						s(r[o]);
																					}return s;
																				})({ 1: [function (require, module, exports) {
																						"use strict";

																						(function e(t, n, r) {
																							function s(o, u) {
																								if (!n[o]) {
																									if (!t[o]) {
																										var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error("Cannot find module '" + o + "'");throw f.code = "MODULE_NOT_FOUND", f;
																									}var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {
																										var n = t[o][1][e];return s(n ? n : e);
																									}, l, l.exports, e, t, n, r);
																								}return n[o].exports;
																							}var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) {
																								s(r[o]);
																							}return s;
																						})({ 1: [function (require, module, exports) {
																								'use strict';

																								function fetchHotpointSummary() {
																									var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

																									XT.signJsonp({
																										url: '/account/hotpoint-summary',
																										data: { userId: XT.search.userId },
																										super_success: function super_success(res) {
																											// console.log('/account/account-by-id=====', res);
																											options.callback && options.callback(res || []);
																										}
																									});
																								}

																								function _withdrawHotpoint() {
																									var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

																									XT.post({
																										url: '/account/withdraw-hotpoint',
																										data: options.data,
																										super_success: function super_success(res) {
																											options.callback && options.callback(res || []);
																										}
																									});
																								}

																								var store = new Vuex.Store({
																									state: {
																										showLoading: true,
																										hotPointSummary: {}
																									},
																									actions: {
																										withdrawHotpoint: function withdrawHotpoint(_ref) {
																											var commit = _ref.commit,
																											    state = _ref.state;
																											var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

																											var that = this;
																											commit('UPDATE_LOADING', { showLoading: true });
																											_withdrawHotpoint({
																												data: payload,
																												callback: function callback(res) {
																													commit('UPDATE_LOADING', { showLoading: false });
																													if (res.code == 'ok') {
																														MINT.Toast({
																															message: '提现成功',
																															duration: 3000
																														});
																														setTimeout(function () {
																															window.location.href = location.origin + '/mywallet/cash_register.html';
																														}, 3000);
																													} else {
																														MINT.MessageBox.alert(res.message || '提现失败');
																													}
																												}
																											});
																										},
																										getHotpointSummary: function getHotpointSummary(_ref2) {
																											var commit = _ref2.commit,
																											    state = _ref2.state;
																											var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

																											fetchHotpointSummary({
																												callback: function callback(res) {
																													commit('UPDATE_LOADING', { showLoading: false });
																													if (res.code == 'ok') {
																														commit('HOT_POINT_SUMMARY', { hotPointSummary: res.data });
																													}
																												}
																											});
																										}
																									},
																									mutations: {
																										HOT_POINT_SUMMARY: function HOT_POINT_SUMMARY(state) {
																											var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

																											state.hotPointSummary = payload.hotPointSummary;
																										},
																										UPDATE_LOADING: function UPDATE_LOADING(state) {
																											var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

																											state.showLoading = !!payload.showLoading;
																										}
																									}
																								});

																								window.App = new Vue({
																									el: '#App',
																									store: store,
																									data: {
																										wxId: '',
																										amount: undefined,
																										minAmount: 10
																									},
																									methods: {
																										commit: function commit() {
																											var _this = this;

																											if (!this.canCommit) {
																												return;
																											}

																											if (this.isError) {
																												MINT.MessageBox.alert(this.withdrawHolderTxt);
																												return;
																											}

																											MINT.MessageBox.confirm('请确认微信号是否正确</br><span class="light-purple">' + this.wxId + '</span>').then(function (action) {
																												var that = _this;
																												XT.getUserInfo(function (info) {
																													that.$store.dispatch('withdrawHotpoint', {
																														hotPoint: that.amount,
																														userId: XT.search.userId,
																														wxId: that.wxId
																													});
																												});
																											});
																										}
																									},
																									computed: {
																										showLoading: function showLoading() {
																											return this.$store.state.showLoading;
																										},
																										canCommit: function canCommit() {
																											return !!(this.wxId && this.amount && !this.isExceeded);
																										},
																										withdrawHolderTxt: function withdrawHolderTxt() {
																											return '请输入' + this.minAmount + '以上整数';
																										},
																										isError: function isError() {

																											if (!this.amount) {
																												return false;
																											}

																											var reg = /^[0-9]+$/;
																											if (!reg.test(this.amount)) {
																												return true;
																											}

																											var amountNum = parseInt(this.amount);
																											if (amountNum < this.minAmount) {
																												return true;
																											}

																											return false;
																										},
																										isExceeded: function isExceeded() {
																											return this.amount > this.hotPointSummary.availableCash;
																										},
																										withdrawTip: function withdrawTip() {
																											// if(this.isError) {
																											// 	return '请输入' + this.minAmount + '以上整数'
																											// }

																											if (this.isExceeded) {
																												return '金额已超过提现金额';
																											}

																											return '可提现金额: ' + this.hotPointSummary.availableCash + '元';
																										},
																										hotPointSummary: function hotPointSummary() {
																											return this.$store.state.hotPointSummary;
																										}
																									},
																									created: function created() {
																										var that = this;
																										XT.getUserInfo(function (info) {
																											that.$store.dispatch('getHotpointSummary');
																										});
																									},
																									mounted: function mounted() {}
																								});
																							}, {}] }, {}, [1]);
																					}, {}] }, {}, [1]);
																			}, {}] }, {}, [1]);
																	}, {}] }, {}, [1]);
															}, {}] }, {}, [1]);
													}, {}] }, {}, [1]);
											}, {}] }, {}, [1]);
									}, {}] }, {}, [1]);
							}, {}] }, {}, [1]);
					}, {}] }, {}, [1]);
			}, {}] }, {}, [1]);
	}, {}] }, {}, [1]);

},{}]},{},[1]);
